package com.triones.ljr.controller.api;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.triones.ljr.entity.vo.EnterpriseVO;
import com.triones.ljr.entity.vo.WxUserVO;
import com.triones.ljr.service.EnterpriseService;
import com.triones.ljr.service.WxUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * api - 我的
 *
 * @Author: triones
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/mine")
public class ApiMineController extends BaseController {

    private final EnterpriseService enterpriseService;

    private final WxUserService wxUserService;

    /**
     * 用户信息
     */
    @GetMapping(value = "/wxUserInfo")
    public R<WxUserVO> getWxUserInfo() {
        return R.ok(wxUserService.getWxUserById());
    }

    /**
     * 我的企业信息
     */
    @GetMapping(value = "/enterpriseInfo")
    public R<EnterpriseVO> enterpriseInfo() {
        return R.ok(enterpriseService.enterpriseInfo());
    }
}
